<template>
    <div>
        <h2 v-for="(item, index) in a" :key="index">{{ item }}---{{ index }}</h2>



        <h4 v-for="value, key, index in b ">{{ value }}--{{ key }}--{{ index }}</h4>
        <!-- 指定次数遍历 -->
        <div v-for="n in 5" :key="n">{{ n }}</div>
    </div>
</template>

<script setup>
import { ref } from 'vue';

const a = ref(['zhangsan', 'lisi', 'wangwu'])
const b = ref({
    id: 1,
    name: 'xiaoming',
    sex: 'nan'
})
</script>

<style lang="scss" scoped></style>